﻿<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<!DOCTYPE html>
<head th:include="common/common_head::commonHeader('dalaoyang')"></head>

<body>
    <div id="wrapper">

        <div th:include="common/navigation :: navigation"></div>

        <div id="page-wrapper" >
            <div id="page-inner">
			 <div class="row">
                    <div class="col-md-12">
                        <h1 class="page-header">
                            <span th:text="${TITLE}"></span><small>注意：保存后直接生效</small>
                        </h1>
                    </div>
                </div> 
                 <!-- /. ROW  -->
              <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            友链信息
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-12">
                                    <form role="form" id="linkForm" th:action="@{/postEditLink}" method="post">
                                        <input type="hidden" name="linkId" th:value="${linkInfo==null?0:linkInfo.linkId}">
                                        <div class="form-group">
                                            <label>友链名称</label>
                                            <input class="form-control" type="text" name="linkName" id="linkName" th:value="${linkInfo==null?'':linkInfo.linkName}" required>
                                        </div>
                                        <div class="form-group">
                                            <label>友链地址</label>
                                            <input class="form-control" type="text" name="linkUrl"  id="linkUrl" th:value="${linkInfo==null?'':linkInfo.linkUrl}" required>
                                        </div>
                                        <div class="form-group">
                                            <label>友链备注</label>
                                            <input class="form-control" type="text" name="remark"  id="remark" th:value="${linkInfo==null?'':linkInfo.remark}" required>
                                        </div>
                                        <button class="btn btn-default" onclick="postLink()">提交</button>
                                    </form>
                                </div>
                                <!-- /.col-lg-6 (nested) -->
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
			<footer>
                <div th:include="common/footer :: footer"></div>
            </footer>
			</div>
             <!-- /. PAGE INNER  -->
            </div>
         <!-- /. PAGE WRAPPER  -->
        </div>

    <script type="text/javascript"  th:inline="javascript">
        function  postLink(){
            $("#linkForm").validate({
                submitHandler:function(form){
                    alert("提交事件!");
                    form.submit();
                }
            });
        }


    </script>
</body>
</html>
